<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Atom 1.0 [Universal Feed Parser]</title>
<link rel="stylesheet" href="feedparser.css" type="text/css">
<link rev="made" href="mailto:mark@diveintomark.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.65.1">
<meta name="keywords" content="RSS, Atom, CDF, XML, feed, parser, Python">
<link rel="start" href="index.html" title="Documentation">
<link rel="up" href="annotated-examples.html" title="Annotated Examples">
<link rel="prev" href="annotated-examples.html" title="Annotated Examples">
<link rel="next" href="annotated-atom03.html" title="Atom 0.3">
</head>
<body id="feedparser-org" class="docs">
<div class="z" id="intro"><div class="sectionInner"><div class="sectionInner2">
<div class="s" id="pageHeader">
<h1><a href="/"><span>Universal Feed Parser</span></a></h1>
<p><span>Parse RSS and Atom feeds in Python.  3000 unit tests.  Open source.</span></p>
</div>
<div class="s" id="quickSummary"><ul>
<li class="li1">
<a href="http://sourceforge.net/projects/feedparser/"><span>Download</span></a> ·</li>
<li class="li2">
<a href="http://feedparser.org/docs/"><span>Documentation</span></a> ·</li>
<li class="li3">
<a href="http://feedparser.org/tests/"><span>Unit tests</span></a> ·</li>
<li class="li4"><a href="http://sourceforge.net/tracker/?func=browse&amp;group_id=112328&amp;atid=661937"><span>Report a bug</span></a></li>
</ul></div>
</div></div></div>
<div id="main"><div id="mainInner">
<p id="breadcrumb">You are here: <a href="index.html">Documentation</a> → <a href="annotated-examples.html">Annotated Examples</a> → <span class="thispage">Atom 1.0</span></p>
<div class="section" lang="en">
<div class="titlepage">
<div>
<div><h2 class="title">
<a name="annotated.atom10" class="skip" href="#annotated.atom10" title="link to this section"><img src="images/permalink.gif" alt="[link]" title="link to this section" width="8" height="9"></a> Atom 1.0</h2></div>
<div><div class="abstract">
<h3 class="title"></h3>
<p>This is a sample Atom 1.0 feed, annotated with links that show how each value can be accessed once the feed is parsed.</p>
</div></div>
</div>
<div></div>
</div>
<a name="id4963178"></a><table class="caution" border="0" summary="">
<tr><td rowspan="2" align="center" valign="top" width="1%"><img src="images/caution.png" alt="Caution" title="" width="24" height="24"></td></tr>
<tr><td colspan="2" align="left" valign="top" width="99%">Even though many of these elements are required according to the specification, real-world feeds may be missing any element.  If an element is not present in the feed, it will not be present in the parsed results.  You should not rely on any particular element being present.</td></tr>
</table>
<div class="example">
<a name="example.annotated.atom10" class="skip" href="#example.annotated.atom10" title="link to this example"><img src="images/permalink.gif" alt="[link]" title="link to this example" width="8" height="9"></a> <h3 class="title">Example: Annotated Atom 1.0 feed</h3>
<pre class="programlisting ">
&lt;?xml version="1.0" encoding="<a href="reference-encoding.html" title="encoding">utf-8</a>"?&gt;
&lt;feed xmlns="<a href="reference-version.html" title="version">http://www.w3.org/2005/Atom</a>"
      xml:base="http://example.org/"
      xml:lang="en"&gt;
  &lt;title type="<a href="reference-feed-title_detail.html#reference.feed.title_detail.type" title="feed.title_detail.type">text</a>"&gt;
    <a href="reference-feed-title.html" title="feed.title">Sample Feed</a>
  &lt;/title&gt;
  &lt;subtitle type="<a href="reference-feed-subtitle_detail.html#reference.feed.subtitle_detail.type" title="feed.subtitle_detail.type">html</a>"&gt;
    <a href="reference-feed-subtitle.html" title="feed.subtitle">For documentation &lt;em&gt;only&lt;/em&gt;</a>
  &lt;/subtitle&gt;
  &lt;link rel="<a href="reference-feed-links.html#reference.feed.links.rel" title="feed.links[i].rel">alternate</a>"
        type="<a href="reference-feed-links.html#reference.feed.links.type" title="feed.links[i].type">html</a>"
        href="<a href="reference-feed-links.html#reference.feed.links.href" title="feed.links[i].href">/</a>"/&gt;
  &lt;link rel="<a href="reference-feed-links.html#reference.feed.links.rel" title="feed.links[i].rel">self</a>"
        type="<a href="reference-feed-links.html#reference.feed.links.type" title="feed.links[i].type">application/atom+xml</a>"
        href="<a href="reference-feed-links.html#reference.feed.links.href" title="feed.links[i].href">http://www.example.org/atom10.xml</a>"/&gt;
  &lt;rights type="<a href="reference-feed-rights_detail.html#reference.feed.rights_detail.type" title="feed.rights_detail.type">html</a>"&gt;
        <a href="reference-feed-rights.html" title="feed.rights">&lt;p&gt;Copyright 2005, Mark Pilgrim&lt;/p&gt;&lt;</a>
  &lt;/rights&gt;
  &lt;generator uri="<a href="reference-feed-generator_detail.html#reference.feed.generator_detail.href" title="feed.generator_detail.href">http://example.org/generator/</a>"
             version="<a href="reference-feed-generator_detail.html#reference.feed.generator_detail.version" title="feed.generator_detail.version">4.0</a>"&gt;
    <a href="reference-feed-generator.html" title="feed.generator">Sample Toolkit</a>
  &lt;/generator&gt;
  &lt;id&gt;<a href="reference-feed-id.html" title="feed.id">tag:feedparser.org,2005-11-09:/docs/examples/atom10.xml</a>&lt;/id&gt;
  &lt;updated&gt;<a href="reference-feed-updated.html" title="feed.updated">2005-11-09T11:56:34Z</a>&lt;/updated&gt;
  &lt;entry&gt;
    &lt;title&gt;<a href="reference-entry-title.html" title="entries[i].title">First entry title</a>&lt;/title&gt;
    &lt;link rel="<a href="reference-entry-links.html#reference.entry.links.type" title="entries[i].links[j].type">alternate</a>"
          href="<a href="reference-entry-links.html#reference.entry.links.href" title="entries[i].links[j].href">/entry/3</a>"/&gt;
    &lt;link rel="<a href="reference-entry-links.html#reference.entry.links.type" title="entries[i].links[j].type">related</a>"
          type="<a href="reference-entry-links.html#reference.entry.links.type" title="entries[i].links[j].type">text/html</a>"
          href="<a href="reference-entry-links.html#reference.entry.links.href" title="entries[i].links[j].href">http://search.example.com/</a>"/&gt;
    &lt;link rel="<a href="reference-entry-links.html#reference.entry.links.type" title="entries[i].links[j].type">via</a>"
          type="<a href="reference-entry-links.html#reference.entry.links.type" title="entries[i].links[j].type">text/html</a>"
          href="<a href="reference-entry-links.html#reference.entry.links.href" title="entries[i].links[j].href">http://toby.example.com/examples/atom10</a>"/&gt;
    &lt;link rel="<a href="reference-entry-enclosures.html" title="entries[i].enclosures">enclosure</a>"
          type="<a href="reference-entry-enclosures.html#reference.entry.enclosures.type" title="entries[i].enclosures[j].type">video/mpeg4</a>"
          href="<a href="reference-entry-enclosures.html#reference.entry.enclosures.href" title="entries[i].enclosures[j].href">http://www.example.com/movie.mp4</a>"
          length="<a href="reference-entry-enclosures.html#reference.entry.enclosures.length" title="entries[i].enclosures[j].length">42301</a>"/&gt;
    &lt;id&gt;<a href="reference-entry-id.html" title="entries[i].id">tag:feedparser.org,2005-11-09:/docs/examples/atom10.xml:3</a>&lt;/id&gt;
    &lt;published&gt;<a href="reference-entry-published.html" title="entries[i].published">2005-11-09T00:23:47Z</a>&lt;/published&gt;
    &lt;updated&gt;<a href="reference-entry-updated.html" title="entries[i].updated">2005-11-09T11:56:34Z</a>&lt;/updated&gt;
    &lt;author&gt;
      &lt;name&gt;<a href="reference-entry-author_detail.html#reference.entry.author_detail.name" title="entries[i].author_detail.name">Mark Pilgrim</a>&lt;/name&gt;
      &lt;uri&gt;<a href="reference-entry-author_detail.html#reference.entry.author_detail.href" title="entries[i].author_detail.href">http://diveintomark.org/</a>&lt;/uri&gt;
      &lt;email&gt;<a href="reference-entry-author_detail.html#reference.entry.author_detail.email" title="entries[i].author_detail.email">mark@example.org</a>&lt;/email&gt;
    &lt;/author&gt;
    &lt;contributor&gt;
      &lt;name&gt;<a href="reference-entry-contributors.html#reference.entry.contributors.name" title="entries[i].contributors[j].name">Joe</a>&lt;/name&gt;
      &lt;url&gt;<a href="reference-entry-contributors.html#reference.entry.contributors.href" title="entries[i].contributors[j].href">http://example.org/joe/</a>&lt;/url&gt;
      &lt;email&gt;<a href="reference-entry-contributors.html#reference.entry.contributors.email" title="entries[i].contributors[j].email">joe@example.org</a>&lt;/email&gt;
    &lt;/contributor&gt;
    &lt;contributor&gt;
      &lt;name&gt;<a href="reference-entry-contributors.html#reference.entry.contributors.name" title="entries[i].contributors[j].name">Sam</a>&lt;/name&gt;
      &lt;url&gt;<a href="reference-entry-contributors.html#reference.entry.contributors.href" title="entries[i].contributors[j].href">http://example.org/sam/</a>&lt;/url&gt;
      &lt;email&gt;<a href="reference-entry-contributors.html#reference.entry.contributors.email" title="entries[i].contributors[j].email">sam@example.org</a>&lt;/email&gt;
    &lt;/contributor&gt;
    &lt;summary type="<a href="reference-entry-summary_detail.html#reference.entry.summary_detail.type" title="entries[i].summary_detail.type">text</a>"&gt;
      <a href="reference-entry-summary.html" title="entries[i].summary">Watch out for nasty tricks</a>
    &lt;/summary&gt;
    &lt;content type="<a href="reference-entry-content.html#reference.entry.content.type" title="entries[i].content[j].type">xhtml</a>"
              xml:base="<a href="reference-entry-content.html#reference.entry.content.base" title="entries[i].content[j].base">http://example.org/entry/3</a>"
              xml:lang="<a href="reference-entry-content.html#reference.entry.content.language" title="entries[i].content[j].language">en-US</a>"&gt;
<a href="reference-entry-content.html#reference.entry.content.value" title="entries[i].content[j].value">      &lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Watch out for
      &lt;span style="background-image: url(javascript:window.location='http://example.org/')"&gt;
      nasty tricks&lt;/span&gt;&lt;/div&gt;</a>
    &lt;/content&gt;
  &lt;/entry&gt;
&lt;/feed&gt;</pre>
</div>
</div>
<div style="float: left">← <a class="NavigationArrow" href="annotated-examples.html">Annotated Examples</a>
</div>
<div style="text-align: right">
<a class="NavigationArrow" href="annotated-atom03.html">Atom 0.3</a> →</div>
<hr style="clear:both">
<div class="footer"><p class="copyright">Copyright © 2004, 2005, 2006 Mark Pilgrim</p></div>
</div></div>
</body>
</html>
